<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="/fuman/js/product.js"></script>
<script language="javascript">
{{if $secondclassID}}
$(document).ready(function(){
	getsecondcate('{{$secondclassID}}');
});
{{/if}}
function setOverFlag(sku,action,flagval){
	if(action!='st'){
		if(!confirm("确定此操作吗")){
			return ;
		}
	}
	$.post("/product/setOverseaFlag", {"sku":sku,"action":action,"flagval":flagval},function (data) {
		if (data.result == 200) {
			if(action=='fba'){
				$("#fbaimg"+sku).attr("src","/fuman/images/"+data.img+".gif");
				$("#fbahref"+sku).attr("href","javascript:alert('如需禁发FBA,请至\'海外管理->海外仓产品目录\'做相关操作');");
				$("#goods_icon"+sku).show();
			}
			
			if(action=='hw'){
				$("#hwimg"+sku).attr("src","/fuman/images/"+data.img+".gif");
				flagval=flagval==1?0:1;
				$("#hwhref"+sku).attr("href","javascript:setOverFlag('"+sku+"','hw',"+flagval+");");
				if(data.insertid>0){
					$("#fbaimg"+sku).attr("src","/fuman/images/"+data.img+".gif");
					$("#fbahref"+sku).attr("href","javascript:alert('如需禁发FBA,请至\'海外管理->海外仓产品目录\'做相关操作');");
				}
				$("#goods_icon"+sku).show();
			}
			if(action=='st'){
				$("#iconimg"+sku).attr("src","/fuman/images/"+data.img+".gif");
				flagval=flagval==1?0:1;
				$("#iconhref"+sku).attr("href","javascript:setOverFlag('"+sku+"','st',"+flagval+");");
				$("#goods_icon"+sku).show();
			}
			alert('设置成功');
		}else {
			alert("您还没有开通设置品的海外仓状态的权限哦");
			//$('#DisabledOrderDiv').modal('hide');
		}
	},"json");
}
function showConifrmForm(dataid){
		$.get("/report/ajaxbutton?op=getShopSaleNum",{"sku":dataid,'selltype':'SELLABLE'},function(data){
			$("#endorderlistst").html(data);
			$('#endorderform').modal('show');
			///sales/ajaxbutton?op=updateStock&needid=	
		})
	}

function changeSaleStatus(flag) {
    if(flag==1){
        var sale_status = $("#sale_status").val();
        if(sale_status==6){ //暂停销售
            $("#proudctcate").empty();
            $("#proudctcate").append("<option value=''>请选择</option>");
            $("#proudctcate").append("<option value='100'>有库存卖光为止</option>");
            $("#proudctcate").append("<option value='101'>无库存暂停销售</option>");
        }else{
            $("#proudctcate").empty();
            var  str_product = "<option value=''>请选择</option>";
            {{foreach from=$proudctcate item=res key=key}}
                str_product+= "<option value='"+"{{$key}}"+"'> {{$res}} </option>";
            {{/foreach}}
            $("#proudctcate").append(str_product);
        }
    }
    if(flag==2){
        var sale_status = $("#sale_status").val();
        var product = $("#proudctcate").val();
        if(sale_status==6){
            if(!product){
                alert("暂停销售的产品标签为必填项!");return false;
            }
        }
        $("#otherforms").submit();
    }

}    
</script>
<title>商品列表</title>
<body class="withvernav">
<div class="bodywrapper">
{{include file='/public/leftmenu.tpl'}}
<div class="centercontent">
<div class="pageheader notab">
  <h1 class="pagetitle">商品列表</h1>
  <span class="pagedesc">
  			 &nbsp;&nbsp;&nbsp;1、<font color="#000099"><B>新&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;品</B></font>：新录入系统的商品默认都为新品状态，录入超过1个月自动标为正常销售<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2、<font color="#000099"><B>暂停销售</B></font>：由于供应商停产/淡季无销售/长时间缺货等原因，开发或维护人员将商品标为暂停销售；
              <br>
             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3、<font color="#000099"><B>清&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;仓</B></font>：由系统自动生成滞销报表，由仓库工作人员提交清仓申请——产品开发维护人员审批——通过审批自动修改成本价，销售平台降价销售；<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4、<font color="#000099"><B>停售产品</B></font>：不再售卖的产品,商品不会再次上架销售，永久关闭。<font color="#FF0000"><B>新订单包含停售商品的标待审查</B></font>
              <br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#FF0000"><B>5、清仓和停售产品状态是不可逆的！不会重新标回销售状态</B></font>
              <br>
  </span>
  <div class="menulist">
    <ul class="profile_summary">
     {{if $managers || in_array('71',$showpower)}}  <li> <a href="/product/addprodct" ><span>添加商品</span></a></li>{{/if}}
    </ul>
  </div>
</div>
<!--pageheader-->

<div id="contentwrapper" class="contentwrapper">
<div id="basicform" class="subcontent">
  
   <!--搜索栏-->
   <div>
   		<div style="float:left">{{if $managers || in_array('92',$showpower)}}  &nbsp;&nbsp; <a href="javascript:void(0)" onClick="MergeProduct()" class="btn btn2 btn_help"><span>合并商品</span></a>
         &nbsp;&nbsp; <a href="javascript:void(0)" onClick="MergecognatelistProudct()" class="btn btn2 btn_help"><span>合并子SKU</span></a>
        &nbsp;&nbsp; <a href="javascript:void(0)" onClick="excelimportformmabang()" class="btn btn2 btn_help"><span>导入商品</span></a>
         {{/if}} 
       {{if $managers || in_array('267',$showpower)}}  &nbsp;&nbsp; <a href="javascript:void(0)" onClick="changbuyman()" class="btn btn2 btn_help"><span>修改采购</span></a>{{/if}}
       &nbsp;&nbsp; <a href="javascript:void(0)" onClick="printcode()" class="btn btn2 btn_help"><span>打印条码</span></a>
      {{if $managers || in_array('269',$showpower)}}&nbsp;&nbsp;<a href="javascript:void(0)" onClick="Maintenance_goods()" class="btn btn2 btn_help"><span>申请维护</span></a>{{/if}}
       </div>
        
       
         <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
   </div>
         
      
    <form class="stdform stdform2" method="get" id="search" action="/product/productlist">
    <input type='hidden' name='if_csv' id='if_csv'>

      <div class="tableoptions"> 
      商品分类
      <select name="bigclassID" id="bigclassID" class="selection" style="width:100px;" onChange="getsecondcate()">
                    <option value="">请选择</option>
                    {{foreach from=$categorylist item=res key=key}}
                    <option value="{{$res.id}}" {{if $bigclassID== $res.id}} selected{{/if}}>{{$res.cate_name}}</option>
                    {{/foreach}}
                  </select>
                  
           <span id="showsecondcate"></span>
               
       <select name="ty" id="searchtype" class="selection" style="width:100px;" >
        <option value="1" {{if $ty==1}} selected{{/if}}>创建时间</option>
        <option value="2" {{if $ty==2}} selected{{/if}}>销量统计</option>
      </select>
    
       <input type="text"  name="starttime" value="{{$starttime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" /> - <input type="text"  name="endtime" value="{{$endtime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" />
          <select name="shippingStatus">
              <option value="">-库存信息-</option>
              {{foreach from=$warehouses item=li key=key}}
              <option value="{{$li.id}}" {{if $shippingStatus==$li.id}} selected{{/if}}>
                  {{$li.storagename}}
              </option>
              {{/foreach}}
          </select>
       <select name="filtertype" style="width:135px;" class="small_input">
								<option value="">-模糊查询条件-</option>
								<option value="goods_sku" {{if $filtertype=='goods_sku'}} selected{{/if}}>按商品编号</option>
                                <!--<option value="warehouse" {{if $filtertype=='warehouse'}} selected{{/if}}>按发货仓库</option>-->
                                <option value="skuc" {{if $filtertype=='skuc'}} selected{{/if}}>精确查询编号</option>
                             
								<option value="goods_name" {{if $filtertype=='goods_name'}} selected{{/if}}>按产品名称</option>
								<option value="goods_brand" {{if $filtertype=='goods_brand'}} selected{{/if}}>按品牌</option>
								<option value="g_buyer" {{if $filtertype=='g_buyer'}} selected{{/if}}>采购员</option>
								<option value="g_checkman" {{if $filtertype=='g_checkman'}} selected{{/if}}>维护员</option>
								<option value="g_weight" {{if $filtertype=='g_weight'}} selected{{/if}}>重量</option>
								<option value="en_goods_name" {{if $filtertype=='en_goods_name'}} selected{{/if}}>英文名</option>
								<option value="cognatelist" {{if $filtertype=='cognatelist'}} selected{{/if}}>子SKU</option>
                                <option value="noprice" {{if $filtertype=='noprice'}} selected{{/if}}>未填成本价</option>
                                <option value="nobulkprice" {{if $filtertype=='nobulkprice'}} selected{{/if}}>未填关联价</option>
                                <option value="isbulk" {{if $filtertype=='isbulk'}} selected{{/if}}>关联商品</option>
                                <option value="ispositions" {{if $filtertype=='ispositions'}}selected{{/if}}>按仓位</option>
							</select> <input type="text" name="other" id="other" class="width300" value="{{$other}}" placeholder="默认SKU(多个以逗号隔开)" />
       &nbsp;
      销售状态:
                          <select class="selectCss2" name="status" id="status">
                    <option value="">请选择</option>
                    {{foreach from=$salestatus item=res key=key}}
                    <option value="{{$key}}" {{if $status==$key}} selected{{/if}}> {{$res}} </option>
                    {{/foreach}}
                  </select>
       供货商
       <select name="supplier" id="supplier" class="selection" >
                    <option value="">请选择</option>
                    {{foreach from=$factory item=res key=key}}
                    <option value="{{$res.id}}" {{if $res.id == $supplier}} selected{{/if}}>{{$res.name}}</option>
                    {{/foreach}}
                  
                  </select>   
              
         销量
       <input type="text" name="saledays" placeholder="填写天数" value="{{$saledays}}" class="width100" >                 
&nbsp;
        <button class="btn btn_orange btn_search radius50">Search</button>
        &nbsp;&nbsp;
       
      <!-- &nbsp;&nbsp; <a href="javascript:void(0)" onclick="moreopenMailNoUrl(1)" class="btn btn2 btn_help"><span>打印条码</span></a>-->
       
      </div>
      
    
    </form>
    <!--搜索栏结束-->
    <div class="x_content" style="overflow-x:auto;">
<table cellpadding="0" cellspacing="0" border="0" class="stdtable">
<thead>
  <tr class="lbbt">
    <td width="5%" bgcolor="#FEFFF1"><a onClick="allSelect('ppid[]')">全选</a></td>
    <td width="5%" bgcolor="#FEFFF1">图片</td>
    <td width="10%" bgcolor="#FEFFF1">SKU</td>
    <td width="20%" bgcolor="#FEFFF1">商品信息</td>
    <td width="5%" bgcolor="#FEFFF1">成本/关联</td>
    <td width="23%" bgcolor="#FEFFF1">库存信息</td>
    <td width="5%" bgcolor="#FEFFF1">销量</td>
    <td width="7%" bgcolor="#FEFFF1">相关负责人</td>
    <td width="5%" bgcolor="#FEFFF1">其他标识</td>
    <td width="15%" bgcolor="#FEFFF1">操作</td>
  </tr>
</thead>

{{foreach from=$goodslist item=detail key=key}}
<tbody id="bdetail{{$detail.p_parent_id}}"  >

  <tr {{if $productlistisparent==1}} {{else}} style="display:none"{{/if}}>
    <td bgcolor="#FEFFF1">
    {{if $productlistissong=="0"}}
    	 <img id='img{{$detail.p_parent_id}}' src="/fuman/images/icons/jia.jpg" width="16" height="16" onClick="showdetail({{$detail.p_parent_id}})" />
         {{else}}
         	 <img id='img{{$detail.p_parent_id}}' src="/fuman/images/icons/jian.jpg" width="16" height="16" onClick="showdetail({{$detail.p_parent_id}})" />
    {{/if}}   </td>
    <td valign="middle" bgcolor="#FEFFF1"></td>
    <td valign="middle" bgcolor="#FEFFF1"><span class="red">{{$detail.p_parent_sku}}</span><br></td>
    <td height="48" valign="middle" bgcolor="#FEFFF1">
     {{$detail.p_parent_name}}<br>
    {{$detail.p_bigclassname}}->{{$detail.p_secondclassname}}->{{$detail.p_threeclassname}}    </td>
    <td valign="middle" bgcolor="#FEFFF1">
    {{if $managers || in_array('258',$showpower)}}
        {{if $detail.p_sale_status==5}}
        		{{if $userid==295}}
                	 <a href="javascript:void(0)" onClick="changstatus({{$detail.p_parent_id}},1,{{$detail.p_sale_status}})">{{$detail.salestatus}}</a>
                {{else}}
        			清仓
            	{{/if}}
          {{elseif $detail.p_sale_status==4}}
         	
            	{{if $userid==295}}
                	 <a href="javascript:void(0)" onClick="changstatus({{$detail.p_parent_id}},1,{{$detail.p_sale_status}})">停售</a>
                {{else}}
        			停售	
            	{{/if}}
            {{else}}
             <a href="javascript:void(0)" onClick="changstatus({{$detail.p_parent_id}},1,{{$detail.p_sale_status}})">{{$detail.salestatus}}</a>
        {{/if}}
    
   
    {{else}}
    {{$detail.salestatus}}
    {{/if}}
    </td>
    <td valign="middle" bgcolor="#FEFFF1">总库存 <font color="#FF0000">{{$detail.allstock}}</font> 价值：<font color="#FF0000">{{$detail.stockPrice}} </font> 直发销量  <font color="#FF0000">{{$detail.allsale}}</font>  总待发货：<font color="#FF0000">{{$detail.allsendgoodsnum}} </font>
    
     </td>
    <td valign="middle" bgcolor="#FEFFF1" class="cz">
    {{if $salestarttime}}
    {{$salestarttime}} <br> {{$saleendtime}}
    
    {{else}}
    {{if $day2}}
    	{{$day1}}/{{$day2}}/{{$day3}}
    
    {{else}}{{$saledays}}{{/if}}天
    {{/if}}    </td>
    <td valign="middle" bgcolor="#FEFFF1" class="cz">&nbsp;</td>

    <td valign="middle" bgcolor="#FEFFF1">
    
    {{if $infringement_arr[$detail['p_parent_sku']]['id']}}
     <a href="javascript:confirm('你确认取消侵权设置吗');setinfringflag('{{$detail.p_parent_sku}}','{{$detail.p_parent_id}}',0)" id="fbahref{{$li.goods_sku}}"><font color="#FF0000">侵权产品</font> <span id="tip_info">侵权备注：{{$infringement_arr[$detail['p_parent_sku']]['reason']}} <br> {{$infringement_arr[$detail['p_parent_sku']]['createUser']}} | {{$infringement_arr[$detail['p_parent_sku']]['addTime']}}</span></a>
    {{else}}
     <a href="javascript:setinfringflag('{{$detail.p_parent_sku}}','{{$detail.p_parent_id}}',1);" id="sinfringflag{{$li.goods_sku}}">标侵权 <span id="tip_info">点击标识该商品在平台侵权</span></a>
    {{/if}}
   
    
    
    </td>
    <td valign="middle" bgcolor="#FEFFF1">
     {{if $managers || in_array('230',$showpower)}}
     <span><img src="/fuman/images/bj.jpg" width="15" height="16" /><a href="/product/EditParentProduct?pid={{$detail.p_parent_id}}" target="_blank">编辑</a></span>
     {{/if}} 
     
     {{if $managers || in_array('83',$showpower)}}<span><img src="/fuman/images/bj.jpg" width="15" height="16" /> <a href="javascript:void(0)" onClick="showsalsku({{$detail.p_parent_id}})">销售SKU</a></span>{{/if}} &nbsp;
     {{if $managers || in_array('80',$showpower)}}
     	{{if $detail.p_supplier==1 || $detail.p_supplier==2}} 
        {{if $userid == 295 || $userid == 120 || $userid == 79 || $userid == 1}}
          <img src="/fuman/images/bj.jpg" width="15" height="16" /><a href="/product/addParentProduct?pid={{$detail.p_parent_id}}">添加子商品</a><br> {{/if}}
        {{else}}
        <img src="/fuman/images/bj.jpg" width="15" height="16" /><a href="/product/addParentProduct?pid={{$detail.p_parent_id}}">添加子商品</a><br>
        {{/if}}
    {{/if}}</td>
    </tr>
    <tbody id="sdetail{{$detail.p_parent_id}}" {{if $productlistissong=="0"}}style="display: none"{{/if}} >
  {{foreach from=$detail.songlist item=li key=key}}
  
  <tr>
    <td {{if $li.goods_sku==$other}}bgcolor="#FFFF99"{{else}}bgcolor="#FFFFFF"{{/if}}><input name="ppid[]" type="checkbox" class="none" id="ppid[]" value="{{$li.goods_id}}"  /></td>
    <td valign="middle" bgcolor="#FFFFFF" style="position:relative;">
     <a href="/product/editProduct?goods_id={{$li.goods_id}}" target="_blank"><img src="{{$li.imagesurl}}" height="80" ></a>
     <span style="position:absolute; top:0;left:0px;">{{if $li.g_sale_status==1}}<img src="/fuman/images/icons/status1.png" width="35">{{/if}}</span>     </td>
    <td valign="middle" bgcolor="#FFFFFF"><a href="/product/editProduct?goods_id={{$li.goods_id}}" target="_blank"><span class="red">{{$li.goods_sku}}</span></a>   </td>
    <td height="58" bgcolor="#FFFFFF">
      <div class="lbcp">
      {{if $li.g_sale_status==5}}<font color="red"><B>【清仓】</B></font>{{/if}}
      {{if $li.g_sale_status==4}}<font color="Blue"><B>【停售(平台下架)】</B></font>{{/if}}
      {{if $li.g_sale_status==7}}<font color="Blue"><B>【下架】</B></font>{{/if}}
       {{if $li.g_sale_status==6}}<font color="Blue"><B>【暂停销售】</B></font>{{/if}}
      {{foreach from=$li.goods_attrlist item=res key=key}}
       {{if $res.attr_value}}
       	{{$res.attr_value}}
        {{/if}}
       {{/foreach}}  {{$li.goods_name}}
     
      <br>
           </div>   </td>
   
    <td valign="middle" bgcolor="#FFFFFF">{{$li.g_costprice}}
<br>{{if $li.bulkprice>0}}{{$li.bulkprice}}{{/if}}</td>
    <td valign="middle" bgcolor="#FFFFFF">
    {{foreach from=$li.storage item=stock key=key}}
       {{if $stock.is_show eq 1}}
        [{{$stock.storage_name}}] 库存：<b class="blue">
        {{if $stock.storage_id ==9}}<a href="javascript:showConifrmForm('{{$li.goods_sku}}')">{{$stock.stock}}</a>{{else}}{{$stock.stock}}{{/if}}
        </b> 在途：<span class="red">{{$stock.in_transit}}
         </span>

          库位： <span class="red">{{if $stock.positions==''}}NULL{{else}} {{$stock.positions}} {{/if}} </span>待发货：{{$stock.sendgoodsnum}} <br>
        {{/if}}
        {{/foreach}}     </td>
    <td bgcolor="#FFFFFF" class="cz">
    {{if $classid ==12 || $classid ==13}}
    		0<br>0<br>0
        {{else}}
    {{if $saledays || $salestarttime}}
         <a href="javascript:void(0)">{{$li.totalday1}}<span id="tip_info">直发销量：{{$li.allday1}} <br>FBA销量：{{$li.allfbaday1}}</span></a><br>
    {{else}}
        <a href="javascript:void(0)">{{$li.allsales1}}<span id="tip_info">直发销量：{{$li.sales1}} <br>FBA销量：{{$li.fbasale1}}</span></a><br>
        <a href="javascript:void(0)">{{$li.allsales2}}<span id="tip_info">直发销量：{{$li.sales2}} <br>FBA销量：{{$li.fbasale2}}</span></a><br>
        <a href="javascript:void(0)">{{$li.allsales3}}<span id="tip_info">直发销量：{{$li.sales3}} <br>FBA销量：{{$li.fbasale3}}</span></a><br>
     
    {{/if}}
    {{/if}}    </td>
    <td bgcolor="#FFFFFF" class="cz">采购：{{$li.g_buyer}}<br>维护：{{$li.g_checkman}}<br>
     {{if $classid ==12 || $classid ==13}}
     {{else}}
    {{if $li.dailysales>0}}日均：{{$li.dailysales}}{{/if}}
    {{/if}}    </td>
    <td valign="middle" align="right" bgcolor="#ffffff" class="cz">
    {{if $li.g_sale_cate ==1}}&nbsp;&nbsp;&nbsp; A类<br> {{/if}}
    {{if $li.g_sale_cate ==2}}&nbsp;&nbsp;&nbsp; B类<br> {{/if}}
    {{if $li.g_sale_cate ==3}}&nbsp;&nbsp;&nbsp; C类<br> {{/if}}

        {{if $li.g_sale_cate ==100}}&nbsp;&nbsp;&nbsp; <span style="color:red;">有库存卖光为止</span><br> {{/if}}
        {{if $li.g_sale_cate ==101}}&nbsp;&nbsp;&nbsp; <span style="color:red;">无库存暂停销售</span><br> {{/if}}
    
   FBA：{{if $oversea_arr[$li['goods_sku']]['id']>0}}<a href="javascript:alert('如需禁发FBA,请至\'海外管理->海外仓产品目录\'做相关操作');" id="fbahref{{$li.goods_sku}}"><img src="/fuman/images/yes.gif" id="fbaimg{{$li.goods_sku}}">{{else}}<a href="javascript:setOverFlag('{{$li.goods_sku}}','fba',1);" id="fbahref{{$li.goods_sku}}"><img src="/fuman/images/no.gif" id="fbaimg{{$li.goods_sku}}">{{/if}}<span id="tip_info"><img src="/fuman/images/yes.gif">：允许发FBA<br>
        <img src="/fuman/images/no.gif">：不允许发FBA</span></a><br>海外仓：{{if $oversea_arr[$li['goods_sku']]['hw']==1}}<a href="javascript:setOverFlag('{{$li.goods_sku}}','hw',0);" id="hwhref{{$li.goods_sku}}"><img src="/fuman/images/yes.gif" id="hwimg{{$li.goods_sku}}">{{else}}<a href="javascript:setOverFlag('{{$li.goods_sku}}','hw',1);" id="hwhref{{$li.goods_sku}}"><img src="/fuman/images/no.gif" id="hwimg{{$li.goods_sku}}">{{/if}}<span id="tip_info"><img src="/fuman/images/yes.gif">：允许发往海外仓库的商品<br>
        <img src="/fuman/images/no.gif">：不允许发往海外仓库的商品</span></a><br>
        <span id="goods_icon{{$li.goods_sku}}" style="display:{{if $oversea_arr[$li['goods_sku']]['id']<1}}none{{/if}};">&nbsp;&nbsp;商标：{{if $oversea_arr[$li['goods_sku']]['st']==1}}<a href="javascript:setOverFlag('{{$li.goods_sku}}','st',0);" id="iconhref{{$li.goods_sku}}"><img src="/fuman/images/yes.gif" id="iconimg{{$li.goods_sku}}">{{else}}<a href="javascript:setOverFlag('{{$li.goods_sku}}','st',1);" id="iconhref{{$li.goods_sku}}"><img src="/fuman/images/no.gif" id="iconimg{{$li.goods_sku}}">{{/if}}<span id="tip_info"><img src="/fuman/images/yes.gif">：带有品牌商标的商品</span></a></span></td>
    <td bgcolor="#FFFFFF" class="cz">
     {{if $managers || in_array('113',$showpower)}}<span><a href="/product/showproduct?goods_id={{$li.goods_id}}" target="_blank"><img src="/fuman/images/bj.jpg" width="15" height="16" />查看</span></a>{{/if}} 
     {{if $managers || in_array('79',$showpower)}}
     <span><img src="/fuman/images/bj.jpg" width="15" height="16" /><a href="/product/editProduct?goods_id={{$li.goods_id}}"  target="_blank">编辑</a></span>
     {{/if}} 
    {{if $managers || in_array('117',$showpower)}}<span><a onClick="return confirm('确认删除？')" href="/product/delproduct?goods_id={{$li.goods_id}}"><img src="/fuman/images/sc.jpg" width="15" height="16" /> 删除</span></a>{{/if}} 
    
    {{if $li.is_update_images >1}}
    
    	{{if $managers || in_array('228',$showpower)}} 
    	<a href="javascript:void(0)" onClick="showProductImages({{$li.is_update_images}})"><img src="/fuman/images/picture0.png"> 图片</a>
        {{/if}}
    {{/if}}   </td>
  </tr>
 
     {{/foreach}}
   </tbody>
  
</tbody>
{{/foreach}}
</table>
</div>
  <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
</div>
</div>

<!-- 模态框（Modal） SKU状态 -->
<form action="/product/ajaxbutton?op=savechangstatus"  method="post" name="otherforms" id="otherforms" >
<input type="hidden" name="statusPid" id="statusPid">
<input type="hidden" name="statusType" id="statusType">
  <div class="modal fade" id="changstatusform" tabindex="-1" role="dialog" aria-labelledby="schangstatusform" aria-hidden="true">
    <div class="modal-dialog" style="width:70%;">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">× </button>
          <h4 class="modal-title" id="schangstatusform">SKU状态 </h4>
        </div>
        <div class="modal-body">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td>销售状态&nbsp;&nbsp;&nbsp;<select class="selectCss2" name="sale_status" id="sale_status" onChange="changeSaleStatus(1)">
                    <option value="">请选择</option>
                    {{foreach from=$salestatus item=res key=key}}
                    	{{if  ($key==4 || $key==5 || $key==1)}}
                        {{else}}
                        <option value="{{$key}}" {{if  ($key==4 || $key==5 || $key==1)}}style="display:none"{{/if}}> {{$res}} </option>
                        {{/if}}
                    
                    {{/foreach}}
                  </select>
                </td>
            </tr>
           	{{if $userid==120 || $userid ==144 || $managers}}
             <tr>
              <td>产品标签&nbsp;&nbsp;&nbsp;
                  <select class="selectCss2" name="proudctcate" id="proudctcate">
                    <option value="">请选择</option>
                    {{foreach from=$proudctcate item=res key=key}}
                    <option value="{{$key}}"> {{$res}} </option>
                    {{/foreach}}
                  </select>
                </td>
            </tr>
            {{/if}}
            
          <tr>
              <td style="line-height:25px;">
             关于状态定义:<br>
              1、<font color="#000099"><B>暂停销售</B></font>：由于供应商停产/淡季无销售/长时间缺货等原因，开发或维护人员将商品标为暂停销售；无需审批，标识后推送销售；
              <br>
              2、<font color="#000099"><B>清&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;仓</B></font>：由系统数据给出滞销报表——仓库工作人员提交清仓申请——产品开发维护人员审批——通过修改成本价，平台降价清仓；<br>
              3、<font color="#000099"><B>停售产品</B></font>： 不再售卖的产品，需要通过审批,商品不会再次上架销售，永久关闭
              <br>
              <font color="#FF0000"><B>4、清仓和停售产品状态是不可逆的！不能重新标回销售状态</B></font>
              <br>
              注意：<br>
              1、修改商品父系商品的销售状态，子系商品的销售状态同步更新<br>
              2、修改单个SKU的销售状态，不会影响到同类的商品。<br>
            
             <font color="#FF0000">3、改变商品的销售状态，系统自动提醒所有销售人员</font>
            
             </td>
            </tr>
          </table>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal"> 关闭 </button>
              <button type="button" class="btn btn-primary"  onclick="changeSaleStatus(2)"> 提交 </button>
              <!--
            <button type="button" class="btn btn-primary"  onclick="AWSsubmit('otherforms','changstatusform')"> 提交 </button>
                -->
          </div>
        </div>
        <!-- /.modal-content --> 
      </div>
      <!-- /.modal-dialog --> 
    </div>
  </div>
</form>
<!-- 模态框（Modal）状态结束 -->

<!-- 模态框（Modal）生成销售SKU -->
<form action="/product/ajaxbutton?op=savesalesku"  method="post" name="otherform" id="otherform" >
  <div class="modal fade" id="addattributeform" tabindex="-1" role="dialog" aria-labelledby="returnaddattributeform" aria-hidden="true">
    <div class="modal-dialog" style="width:740px;">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">× </button>
          <h4 class="modal-title" id="returnaddattributeform">生成销售SKU </h4>
        </div>
        <div class="modal-body">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td> <div style="width:100%;height:650px; overflow-y:scroll; border:0px solid;">
              	
            <span id="showsaleskuid"></span>
            </div></td>
            </tr>
          <tr>
              <td>需要用到的销售SKU，请绑定对应店铺，否则请留空，避免资源浪费！</td>
            </tr>
          </table>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal"> 关闭 </button>
            <button type="button" class="btn btn-primary"  onclick="AWSsubmit('otherform','addattributeform')"> 提交 </button>
          </div>
        </div>
        <!-- /.modal-content --> 
      </div>
      <!-- /.modal-dialog --> 
    </div>
  </div>
</form>
<!-- 模态框（Modal）生成销售结束 -->



<!-- 模态框（Modal） 合并商品-->
<form action="/product/ajaxbutton?op=saveMergeProduct"  method="post" name="uctform" id="uctform" >
<input type="hidden" name="MergeProductID" id="MergeProductID">
  <div class="modal fade" id="MergeProductform" tabindex="-1" role="dialog" aria-labelledby="sMergeProductform" aria-hidden="true">
    <div class="modal-dialog" style="width:740px;">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">× </button>
          <h4 class="modal-title" id="sMergeProductform">合并商品 </h4>
        </div>
        <div class="modal-body">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td>Parent SKU&nbsp;&nbsp;&nbsp;<input type="text" name="ParentSku" class="width400" value="" required>
                </td>
            </tr>
          <tr>
              <td style="line-height:25px;">说明：<br>
              所选的商品SKU合并到另外一个Parent SKU下面,<br>例如：
              将16901-XXL，16901-XL，16901-S合并到11006901<br>
             
             </td>
            </tr>
          </table>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal"> 关闭 </button>
            <button type="button" class="btn btn-primary"  onclick="AWSsubmit('uctform','MergeProductform')"> 提交 </button>
          </div>
        </div>
        <!-- /.modal-content --> 
      </div>
      <!-- /.modal-dialog --> 
    </div>
  </div>
</form>
<!-- 模态框（Modal）合并商品 -->


<!-- 模态框（Modal） 合并子SKU信息-->
<form action="/product/ajaxbutton?op=saveMergecognatelistProudct"  method="post" name="uctSUBform" id="uctSUBform" >
<input type="hidden" name="MergeSUBProductID" id="MergeSUBProductID">
  <div class="modal fade" id="MergecognatelistProductform" tabindex="-1" role="dialog" aria-labelledby="sMergecognatelistProductform" aria-hidden="true">
    <div class="modal-dialog" style="width:740px;">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">× </button>
          <h4 class="modal-title" id="sMergecognatelistProductform">合并子SKU信息 </h4>
        </div>
        <div class="modal-body">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td>商品编号&nbsp;&nbsp;&nbsp;<input type="text" name="ParentSku" class="width400" value="" required>
                </td>
            </tr>
          <tr>
              <td style="line-height:25px;">说明：<br>
              将所选SKU合并到某个SKU下做为子SKU信息存在,<br>例如：
              将MT1366-XL 做为134835-XL的子SKU，选择MT1366-XL填写134835-XL <br>
              注意：如果MT1366-XL出过订单，所有订单的SKU将修改成合并之后的
             
             </td>
            </tr>
          </table>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal"> 关闭 </button>
            <button type="button" class="btn btn-primary"  onclick="AWSsubmit('uctSUBform','MergecognatelistProductform')"> 提交 </button>
          </div>
        </div>
        <!-- /.modal-content --> 
      </div>
      <!-- /.modal-dialog --> 
    </div>
  </div>
</form>
<!-- 模态框（Modal）合并子SKU信息结束 -->

<!-- 模态框（Modal） 打印条码-->
<form action="/product/ajaxbutton?op=saveprintcode"  method="post" name="uctformst" id="uctformst" >
  <div class="modal fade" id="printcodeIDfrom" tabindex="-1" role="dialog" aria-labelledby="sprintcodeIDfrom" aria-hidden="true">
    <div class="modal-dialog" style="width:740px;">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">× </button>
          <h4 class="modal-title" id="sprintcodeIDfrom">打印条码 </h4>
        </div>
        <div class="modal-body">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
             <tr>
              <td> <div style="width:100%;height:400px; overflow-y:scroll; border:0px solid;">
              	
            <span id="wordergoodshtml"></span>
            </div></td>
            </tr>
          </table>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal"> 关闭 </button>
            <button type="button" class="btn btn-primary"  onclick="saveprintcode()"> 提交 </button>
          </div>
        </div>
        <!-- /.modal-content --> 
      </div>
      <!-- /.modal-dialog --> 
    </div>
  </div>
</form>
<!-- 模态框（Modal）打印条码 -->

<!-- 模态框（Modal）导入马帮商品 -->
  <form action="/product/ajaxbutton?op=doImportProduct" enctype="multipart/form-data" method="post" name="excelattributeform" id="excelattributeform">
        <div class="modal fade" id="newexcelform" tabindex="-1" role="dialog" aria-labelledby="snewexcelform" aria-hidden="true">
            <div class="modal-dialog" style="width:740px;">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"
                                aria-hidden="true">× </button>
                        <h4 class="modal-title"><span id="order_mailno">导入Excel文档</span></h4>
                    </div>
                    <div class="modal-body">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td width="100">导入Excel表： </td>
                                <td align="left">
                                    <input  type="file" name="file_excel" />
                                </td>
                            </tr>
                             <tr>
                                <td width="100">类型： </td>
                                <td align="left">
                                   <select name="Importtyps" id="Importtyps">
                                     <option value="0">请选择类型</option>
                                     <option value="1">导入开发期类型</option>
                                     <option value="2">导入新SKU</option>
                                   </select>
                                </td>
                            </tr>
                            <tr>
                                <td width="100">注意： </td>
                                <td align="left">
                                    文档格式： 导入新SKU请参照  <a href="/fuman/Exceltemplate/Newimport20170829.xls"><font color="#0000FF">下载模板</font></a><br>开发期类型产品，SKU信息会被系统保存，但不显示，过了开发期后，如果销售可观，可以开放所有尺码。
                                </td>
                            </tr>
                        </table>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default"
                                    data-dismiss="modal" style="display:none"> 关闭 </button>
                            <button type="button" class="btn btn-primary"  onclick="doImportProduct()">导入</button>
                        </div>
                    </div>
                    <!-- /.modal-content -->
                </div>
                <!-- /.modal-dialog -->
            </div>
        </div>
    </form>
    <!-- /.modal -->
    
    
    <!-- 模态框（Modal）修改采购人员 -->
  <form action="/product/ajaxbutton?op=dochangbuyman"  method="post" name="dochangbuymanfrom" id="dochangbuymanfrom">
        <div class="modal fade" id="changbuymanfromtye" tabindex="-1" role="dialog" aria-labelledby="schangbuymanfromtye" aria-hidden="true">
            <div class="modal-dialog" style="width:740px;">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"
                                aria-hidden="true">× </button>
                        <h4 class="modal-title"><span id="order_mailno">批量修改采购人员</span></h4>
                    </div>
                    <div class="modal-body">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        	
                            <tr style="display:none" id="showchildbuyman">
                                <td width="100">ID号： </td>
                                <td align="left">
                                   <textarea name="BuychangparentSKUID" id="BuychangparentSKUID" cols="12" rows="12"></textarea>
                                </td>
                            </tr>
                        
                            <tr  id="showchildbuymansku">
                                <td width="100">主SKU： </td>
                                <td align="left">
                                   <textarea name="BuychangparentSKU" id="BuychangparentSKU" cols="12" rows="12"></textarea>
                                   <br>主SKU 一行一个，（不带尺码的SKU）
                                </td>
                            </tr>
                            
                            <tr>
                                <td width="100">采购人员： </td>
                                <td align="left">
                                
                                
                                 <select name="Buychangbuyman" id="Buychangbuyman"   style="width:150px;z-index:1" >
        <option value="" >采购人员</option>
        {{foreach from=$userlist item=li key=key}}
              <option value="{{$li.name}}" >{{$li.username}} {{$li.name}}</option>
        {{/foreach}}
        </select>
                                
                                
                                </td>
                            </tr>
                        </table>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default"
                                    data-dismiss="modal" style="display:none"> 关闭 </button>
                            <button type="button" class="btn btn-primary"  onclick="dochangbuyman()">导入</button>
                        </div>
                    </div>
                    <!-- /.modal-content -->
                </div>
                <!-- /.modal-dialog -->
            </div>
        </div>
    </form>
    <!-- /.modal -->

<!-- 模态框（Modal） 请求维护商品信息-->
<form action="/product/ajaxbutton?op=saveMaintenanceist"  method="post" name="Maintenanceisttform" id="Maintenanceisttform" >
<input type="hidden" name="MaintenanceistProductID" id="MaintenanceistProductID">
  <div class="modal fade" id="Maintenancegoodsform" tabindex="-1" role="dialog" aria-labelledby="sMaintenancegoodsform" aria-hidden="true">
    <div class="modal-dialog" style="width:740px;">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">× </button>
          <h4 class="modal-title" id="sMaintenancegoodsform">请求维护商品信息 </h4>
        </div>
        <div class="modal-body">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td>
                  <select name="Maintenanceist">
                  	<option value="">请选择建议</option>
                    <option value="建议暂停销售">建议暂停销售</option>
                    <option value="建议销售">建议销售</option>
                  </select>
                  
                  <input name="Maintenanceistbmemo" placeholder="理由" class="width200" type="text" id="Maintenanceistbmemo">		
              </td>
            </tr>
          <tr>
              <td style="line-height:25px;">允许提交的商品说明：<br>
              1、供货商是外采购。<br>
              2、商品的采购和开发人员不包括以下人员：<span id="showexternalprotector"></span>
              <input type="hidden" name="protector" id="externalprotector">
             
             </td>
            </tr>
          </table>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal"> 关闭 </button>
            <button type="button" class="btn btn-primary"  onclick="AWSsubmit('Maintenanceisttform','Maintenancegoodsform')"> 提交 </button>
          </div>
        </div>
        <!-- /.modal-content --> 
      </div>
      <!-- /.modal-dialog --> 
    </div>
  </div>
</form>
<!-- 模态框（Modal）合并子SKU信息结束 -->


<!-- 模态框（Modal） 标识侵权-->
<form action="/product/ajaxbutton?op=savesetinfringflag"  method="post" name="suctform" id="suctform" >
<input type="hidden" name="infring_sku" id="infring_sku">
<input type="hidden" name="infring_type" id="infring_type">
<input type="hidden" name="infring_status" id="infring_status">
  <div class="modal fade" id="setinfringflagform" tabindex="-1" role="dialog" aria-labelledby="setinfringflagform" aria-hidden="true">
    <div class="modal-dialog" style="width:740px;">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">× </button>
          <h4 class="modal-title" id="setinfringflagform">标识商品侵权 </h4>
        </div>
        <div class="modal-body">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td>备注：<input type="text" name="reason" class="width400" value="" required>
                </td>
            </tr>
          <tr>
              <td style="line-height:25px;">说明：<br>
              填写侵权备注
             
             </td>
            </tr>
          </table>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal"> 关闭 </button>
            <button type="button" class="btn btn-primary"  onclick="AWSsubmit('suctform','setinfringflagform')"> 提交 </button>
          </div>
        </div>
        <!-- /.modal-content --> 
      </div>
      <!-- /.modal-dialog --> 
    </div>
  </div>
</form>
<!-- 模态框（Modal）标识侵权 -->



<div class="modal fade" id="endorderform" tabindex="-1" role="dialog" aria-labelledby="sendorderform" aria-hidden="true">
    <div class="modal-dialog" style="width:440px;">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">× </button>
          <h4 class="modal-title" id="sendorderform">在售商铺列表</h4>
        </div>
        <div class="modal-body">
         <span id="errshow"></span>
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
          
          <div style="width:100%;overflow:auto; border:0px solid;">
           <span id="endorderlistst">
           </span>
           <span id="fileinput"></span>
          </div>
          </table>
        </div>
        <!-- /.modal-content --> 
      </div>
      <!-- /.modal-dialog --> 
    </div>
  </div>

    <div id="goToTop" style="display:none"><a href="javascript:;">TOP</a></div>
</body>
</html>